<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="Author" content="Super3D Inc." />
        <meta name="viewport" content="width=1024" />
        <title><?php echo $model_info->mname . ' by ' . $model_info->username . ' on Super3D'?> by electrobloom on super3d</title>
        
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" type="text/css" href="/rrstatic/stylesheets/screen.css?tag=<?php echo $tag?>"/>
		<link rel="stylesheet" type="text/css" href="/rrstatic/styles/jquery/jquery-ui-1.8.18.custom.css?tag=<?php echo $tag?>">
		<link rel="stylesheet" type="text/css" href="/rrstatic/styles/jquery/jquery.selectbox.css?tag=<?php echo $tag?>">
		
		<script type="text/javascript" src="/rrstatic/javascript/jquerys.min.js?tag=<?php echo $tag?>"></script>
		<script type="text/javascript" src="/rrstatic/javascript/shared.jquery.js?tag=<?php echo $tag?>"></script>
		<script type="text/javascript" src="/rrstatic/javascript/portal/Spuser3DApp.jquery.js?tag=<?php echo $tag?>"></script>
		<!--[if lte IE 7]>
	    <link rel="stylesheet" href="rrstatic/stylesheets/jquery.fancybox.css?tag=20130604" type="text/css" media="screen" />
	    <script type="text/javascript" src="/rrstatic/javascript/fancybox/jquery.fancybox2.js?tag=<?php echo $tag?>"></script>
	    <script type="text/javascript">
	        $(document).ready(function() {
	        $(".fancybox").fancybox();
	        $("#browser-redirect").fancybox().trigger('click');
	        SW.track('ie7-beware', { });
	      });
	    </script>
	    <div style="display:none;">
	      <div id="browser-redirect" style="width:600px; position:relative;">
	        <div style="margin:10px auto; text-align:center;"><img border="0" style="width: 163px; " alt="Logo" src="/rrstatic/img/sw-logo-dark.png"></div>
	        <h2><strong>Hello.</strong></h2>
	        <p>We're sorry to inform you that we no longer support this browser and can't confirm that everything will work as expected. For the best Spuser3D experience, please use one of the following browsers:</p>
	        <p>
	          <ul class="support-list">
	            <li>Get <a href="https://www.google.com/intl/en/chrome/browser/">Google Chrome</a></li>
	            <li>Get <a href="http://www.mozilla.org/en-US/firefox/new/">Firefox</a></li>
	            <li>Get <a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie">Internet Explorer</a> latest version</li>
	          </ul>
	        </p>
	
	        <small><em>Click anywhere outside this window to continue.</em></small>
	      </div>
	    </div>
	  <![endif]-->
	  <link rel="stylesheet" href="/rrstatic/stylesheets/jquery.fancybox.css?tag=<?php echo $tag?>" type="text/css" media="screen">
	  <script type="text/javascript" src="/rrstatic/javascript/fancybox/jquery.fancybox2.js?tag=<?php echo $tag?>" defer="defer"></script>
        <script>
            document.documentElement.className = 'js';
        </script>
        <script type="text/javascript">
            (function($){
                if (typeof $.swPortal == 'undefined') {
                    $.swPortal = {};
                }
                $.swPortal.rid = '1554793245';
                $.swPortal.pageModelId = 209888;
                $.swPortal.eventTracking = {
                    modelShareIntent: 'model_share_intent',
                    modelShareIntentComplete: 'model_share_intent_complete',
                    modelShareIntentLoggedOut: 'model_share_intent_logged_out'
                };
                $.swPortal.facebookAppId = '196244320391665';
                $.swPortal.isLogin = <?php echo $is_login?>;
            })(jQuery);
        </script>
        <script type="text/javascript">
	        if (typeof $.swPortal == 'undefined') {
	            $.swPortal = {};
	        }
	        $.swPortal.uid = <?php echo $uid?>;
	        $.swPortal.mid = <?php echo $mid?>;
	        $.swPortal.modelPageDestinationUrl = '/page/model.php?mid=<?php echo $mid?>&i=<?php echo $mname?>';
	        $.swPortal.modelPageModelId = <?php echo $mid?>;
	        $.swPortal.modelPageModelKey = 'bdb5b81567ffdf09da76b9a4e160356f';
	        $.swPortal.modelPageMaterialId = '6';
	        $.swPortal.totalPics = <?php echo count($model_pictures)?>;
	        
        </script>
    </head>
    <body class="sct-model ">
        <input type="hidden" id="requestTrackingId" value="1554793245"/>
        <div class="">
            <?php include VIEW . '/head.php';?>
            <!-- ADD TO CART POPUP -->
            <div id="addtocart_popup_container" style="display:none;">
            </div>
            <script>
                $('#addtocart_popup_container').prependTo('#header').show();
                function close_addtocart_popup(){
                    var pop = document.getElementById('addtocart_popup_container');
                    pop.style.display = 'none';
                }
            </script>
            <!-- END ADD TO CART POP UP -->
            <div class=" clearfix ">
                <script type="text/javascript">
                    
                  var countryCurrencyControlOpen = false;
                    var countryCurrencyControlOperating = false;
                    var materialControlOpen = false;
                    var materialControlOperating = false;
                    var experimentalMaterials = new Array('68');//68=BEP
                    function bindCurrencyAndMaterialSelection(){
                        $("#countryCurrencySelect").mouseenter(function(e){
                            countryCurrencyControlOperating = true;
                        });
                        $("#countryCurrencySelect").mouseleave(function(e){
                            countryCurrencyControlOperating = false;
                        });
                        $("#countryCurrencySelectControl").click(function(e){
                            $("#countryCurrencySelect").show(1, null, function(){
                                countryCurrencyControlOpen = true;
                            });
                        });
                        
                        $("#materialSelectControl").click(function(e){
                            showDialog("materialSelect", "Select Material", true, '635px', 'materialSelect');
                        });
                        
                        $(".material-list-item").click(function(e){
                            var targetId = $(e.currentTarget).attr('id');
                            selectMaterial(targetId.substring('materialContent'.length));
                        });
                        
                        $("#submitChangeCountryCurrency").click(function(){
                            var params = {
                                currencyCode: $('input[name=currencyCode]:checked').val(),
                                country: $('#autocompleteCountry').val(),
                                itemId: $.swPortal.modelPageModelId,
                                materialId: $.swPortal.modelPageMaterialId,
                                method : 'change'
                            };
                            $.post('/ajax/country.php', params, function(response){
                                if (response) {
                                    $("#purchaseDetails").html(response);
                                    bindCurrencyAndMaterialSelection();
                                }
                            });
                        });
                        
                        $("#autocompleteCountry").autocomplete({
                            source: '/ajax/country.php',
                            minLength: 1,
                            select: function(event, ui){
                                countryCurrencyControlOperating = true;
                            }
                        });
                        
                    }
                    
                    function updateWishlists(){
                        var modelId = $.swPortal.modelPageModelId;
                        var materialId = $.swPortal.modelPageMaterialId;
                        
                        jQuery.ajax({
                            type: "POST",
                            url: '/ajax/wishlist.php',
                            data: {
                                model_id: modelId,
                                material_id: materialId,
                                list_name: 'wishlist',
                                method : 'wishlist'
                            },
                            dataType: 'json',
                            success: function(is_favorite){
                                if (is_favorite['user_list_model_id'] != null) {
                                    jQuery('#wishlistLink').addClass('disabled');
                                }
                                else {
                                    jQuery('#wishlistLink').removeClass('disabled');
                                }
                            }
                        });
                        
                        jQuery.ajax({
                            type: "POST",
                            url: '/ajax/wishlist.php',
                            data: {
                                model_id: modelId,
                                material_id: materialId,
                                list_name: 'favorites',
                                method : 'favorites'
                            },
                            dataType: 'json',
                            success: function(is_favorite){
                                if (is_favorite['user_list_model_id'] != null) {
                                    jQuery('#favoritesLink').addClass('disabled');
                                    jQuery("#favoriters").show();
                                    jQuery("#youFavorite").show();
                                }
                                else {
                                    jQuery('#favoritesLink').removeClass('disabled');
                                    jQuery("#favoriters").hide();
                                    jQuery("#youFavorite").hide();
                                }
                            }
                        });
                    }
                    
                    function showExperimentalNotice(){
                        if (jQuery.inArray($.swPortal.modelPageMaterialId, experimentalMaterials) > -1) {
                            jQuery('#experimentalMaterialNotice').show();
                        }
                        else {
                            jQuery('#experimentalMaterialNotice').hide();
                        }
                    }
                    
                    $(document).ready(function(){
                        bindCurrencyAndMaterialSelection();
                        $(document).click(function(e){
                            if (countryCurrencyControlOpen && !countryCurrencyControlOperating) {
                                $("#countryCurrencySelect").hide(1, null, function(){
                                    countryCurrencyControlOpen = false;
                                    countryCurrencyControlOperating = false;
                                });
                            }
                        });
                        
                        //find selected picture and set as selectedPicId
                        selectedPicId = parseInt(jQuery('a.selected')[0].id.replace('picThumb', ""));
                        showPicture(selectedPicId);
                        
                        $("#commentBox").focus(function(e){
                            if ($("#commentBox").val() == '你想要分享吗? @说起 用户直接分享给他们。') {
                                $("#commentBox").val("");
                                $("#commentBox").removeClass("instructional").addClass("focus");
                            }
                        });
                        $("#commentBox").blur(function(e){
                            if ($.trim($("#commentBox").val()) == '') {
                                $("#commentBox").val("你想要分享吗? @说起 用户直接分享给他们。");
                                $("#commentBox").addClass("instructional").removeClass('focus');
                            }
                        });
                        
                        jQuery('.close').click(function(){
                            $.post('/model/acknowledge-rescale/' + 209888, null, function(response){
                                jQuery('.acknowledge-rescale').hide();
                                jQuery('.outside-popup').hide();
                            });
                        });
                        
                        //when material is switched update favorites and wishlist
                        jQuery('#materialSelect li').click(updateWishlists);
                        
                        if ($('#prodLeadDays').length) {
                            //when material is switched update production lead time for cocreators
                            jQuery('#materialSelect li').click(function(){
                                if (typeof $.swPortal.materialLeadTimes != 'undefined' && typeof $.swPortal.materialLeadTimes[$.swPortal.modelPageMaterialId] != 'undefined') {
                                    $('#prodLeadDays').text($.swPortal.materialLeadTimes[$.swPortal.modelPageMaterialId]);
                                    $('#prodLeadDaysNotice').show();
                                }
                                else {
                                    $('#prodLeadDaysNotice').hide();
                                }
                                $('#customizeFormMaterialId').val($.swPortal.modelPageMaterialId);
                            });
                        }
                        
                        //set initial experimental notice for if BEP is default material
                        showExperimentalNotice();
                        
                        
                        $.swPortal.addPersonalizedToCart = function(){
                            if ($(this).hasClass('disabled')) {
                                return false;
                            }
                            if (!$('#customizeFormIframe').length) {
                                var iframe = $('<iframe name="customizeFormIframe" id="customizeFormIframe" style="display: none" />');
                                $("body").append(iframe);
                                
                                $("#customizeFormIframe").load(function(){
                                    var iframeContents = $("#customizeFormIframe").contents().find('body').text();
                                    if (iframeContents) {
                                        var result = null;
                                        try {
                                            result = $.parseJSON(iframeContents);
                                        } 
                                        catch (exception) {
                                        }
                                        if (result) {
                                            if (typeof result['coCreatorFieldsHtml'] != 'undefined' && result['coCreatorFieldsHtml']) {
                                                $('#coCreatorCustomizeContainer').html(result['coCreatorFieldsHtml']);
                                                $('#coCreatorCustomizeContainer .customize-cocreator-button').click($.swPortal.showCoCreatorFields);
                                                $('#coCreatorCustomizeContainer .cocreator-customize-settings-close a').click($.swPortal.closeCoCreatorFields);
                                                $('#coCreatorCustomizeContainer .add-personalized-to-cart').click($.swPortal.addPersonalizedToCart);
                                            }
                                            if (typeof result['success'] != 'undefined' && result['success']) {
                                                $('.cocreator-customize-settings').hide();
                                                if (typeof result['modelId'] != 'undefined' && typeof result['materialId'] != 'undefined') {
                                                    var params = {
                                                        itemId: result['modelId'],
                                                        materialId: result['materialId'],
                                                        'method' : 'add'
                                                    };
                                                    //$.swPortal.addToCartPopup('/cart/add/ajax', params);
                                                    $.swPortal.addToCartPopup('/ajax/cart.php', params);
                                                }
                                                else {
                                                    document.location.href = '/page/mymodels.php';
                                                }
                                                $('.customize-cocreator-button').show();
                                                $('.add-personalized-to-cart').hide();
                                                $('#customizeForm')[0].reset();
                                                $('#customizeForm').find('p.error').remove();
                                            }
                                        }
                                    }
                                });
                            }
                            
                            var form = $('#customizeForm');
                            form.attr("action", "/cocreator/cart/add");
                            form.attr("target", "customizeFormIframe");
                            form.submit();
                            
                            return false;
                        };
                        
                        $.swPortal.closeCoCreatorFields = function(){
                            $('.customize-cocreator-button').show();
                            $('.cocreator-customize-settings').hide();
                            $('.add-personalized-to-cart').hide();
                            return false;
                        };
                        
                        $.swPortal.showCoCreatorFields = function(){
                            if ($(this).find('a')) {
                                $('.customize-cocreator-button').hide();
                                $('.cocreator-customize-settings').show();
                                $('.add-personalized-to-cart').show();
                                return false;
                            }
                        };
                        
                        $('.customize-cocreator-button').click($.swPortal.showCoCreatorFields);
                        $('.cocreator-customize-settings-close a').click($.swPortal.closeCoCreatorFields);
                        $('.add-personalized-to-cart').click($.swPortal.addPersonalizedToCart);
                        $(".fancybox").fancybox();
                        
                        
                    });
                    function selectMaterial(materialId){
                        $("#selectedMaterialContent").html($("#materialContent" + materialId).html());
                        $.swPortal.modelPageMaterialId = materialId;
                        $.swPortal.modelPageDestinationUrl = '/page/model.php?mid=' + $.swPortal.mid + '&modelId=' + $.swPortal.mid + '&materialId=' + materialId;
                        $.swPortal.modelPageDestinationUrl = '/page/model.php?mid=' + $.swPortal.mid + '&i=' + $.swPortal.mid + '&materialId=' + materialId;
                        showExperimentalNotice();
                        $("#materialSelect").dialog('close');
                    }
                    
                    function addToFavorites(){
                        var params = {
                        	listId: $.swPortal.uid,
                            uid : $.swPortal.uid,
                            mid : $.swPortal.mid,
                            isPrivate: 0,
                            materialId: $.swPortal.modelPageMaterialId,
                            method : 'addToFavorites'
                        };
                        if(!$.swPortal.isLogin){
                        	//window.location.href = '/page/login.php';
                        	alert("请登录后操作...........");
                        	return;
                        }
                        if ($("#favoritesLink").hasClass('disabled')) {
                            window.location.href = '/page/wishlist.php/?list_id=' + params['listId'];
                        }
                        else {
                            //$.post("/model/add-to-list/" + $.swPortal.modelPageModelId, params, function(response){
                        	$.post("/ajax/model.php", params, function (response) {
                                if (response == '1') {
                                    if (params['isPrivate'] == 0) {
                                        $("#favoriters").show();
                                        $("#youFavorite").show();
                                    }
                                    $("#favoritesLink").html('收藏');
                                    $("#favoritesLink").addClass('disabled');
                                }
                            });
                        }
                    }
                    
                    function addToWishlist(){
                        var params = {
                            listId: $.swPortal.uid,
                            uid : $.swPortal.uid,
                            mid : $.swPortal.mid,
                            materialId: $.swPortal.modelPageMaterialId,
                            method : 'addToWishlist'
                        };
                        if(!$.swPortal.isLogin){
                        	//window.location.href = '/page/login.php';
                        	alert("请登录后操作...........");
                        	return;
                        }
                        if ($("#wishlistLink").hasClass('disabled')) {
                            window.location.href = '/page/wishlist.php/?list_id=' + params['listId'];
                        }
                        else {
                            //$.post("/model/add-to-list/" + $.swPortal.modelPageModelId, params, function(response){
                        	$.post("/ajax/model.php", params, function (response) {
                               if (response == '1') {
                                    $("#wishlistLink").html('关注');
                                    $("#wishlistLink").addClass('disabled');
                                }
                            });
                        }
                    }
                    
                    function showLoading(selector, size){
                        $(selector).html("<img src='/rrstatic/img/portal/loading" + size + ".png'")
                    }
                    
                    var currentPicId = 0;
                    var selectedPicId = 0;
                    var totalPics = $.swPortal.totalPics;
                    
                    function nextPicture(){
                        if (selectedPicId == totalPics - 1) {
                            return;
                        }
                        showPicture(selectedPicId + 1);
                    }
                    
                    function prevPicture(){
                        if (selectedPicId == 0) {
                            return;
                        }
                        showPicture(selectedPicId - 1);
                    }
                    
                    function animateFilmStrip(){
                        showPicture(selectedPicId);
                    }
                    
                    function showPicture(picId){
                        selectedPicId = picId;
                        $("#slideshow-big").html($("#pic" + picId).html());
                        for (var i = 0; i < 12; i++) {
                            if (picId != i) {
                                $("#picThumb" + i).removeClass('selected');
                            }
                        }
                        $("#picThumb" + picId).addClass('selected');
                        var scrollOffset = Math.min(totalPics - 5, selectedPicId);
                        scrollOffset = Math.max(0, scrollOffset);
                        $("#film-strip").animate({
                            left: (scrollOffset * -130)
                        }, 267, null, function(){
                            currentPicId = selectedPicId;
                        });
                        
                        if (selectedPicId == 0) {
                            $("#slideShowLeft").hide();
                        }
                        else {
                            $("#slideShowLeft").show();
                        }
                        if (selectedPicId == totalPics - 1) {
                            $("#slideShowRight").hide();
                        }
                        else {
                            $("#slideShowRight").show();
                        }
                    }
                </script>
                <div class="container">
                    <div class="item-designed-by headline-container clearfix">
                        <div class="shop-info">
                            <div class="avatar">
                                <a href="/page/shops.php?uid=<?php echo $model_info->uid?>">
                                	<img height="50" width="50" src="/rrstatic/img/avatar/50x50_21166_575d8dba3d7fa81e4147b7073fe9ed83.png" alt="<?php echo $model_info->mname?>">
                                </a>
                            </div>
                            <div class="shop-info-text">
                                <h1><?php echo $model_info->mname?></h1>
                                <div class="product-stat-designer">
                                    设计师：<a href="/page/designer.php?i=<?php echo $model_info->uid?>"><?php echo $model_info->username?></a>
                                </div>
                                <div class="product-stat">
                                    <div class="rating-wrapper">
                                        <ul id="modelRatingDiv">
                                            <div class="ratingDiv">
                                                (<?php echo $model_info->rating_num?>)&nbsp;
                                            </div>
                                            <ul id="modelRating<?php echo $mid?>" class="rating">
                                                <li class="current" style="width: <?php echo $model_info->rating?>em;">
                                                    <?php echo $model_info->rating?> out of 5
                                                </li>
                                                <li>
                                                    <a href="javascript:rateModel(<?php echo $mid?>, 1);" class="rate1" title="I hated it">*</a>
                                                </li>
                                                <li>
                                                    <a href="javascript:rateModel(<?php echo $mid?>, 2);" class="rate2" title="I disliked it">*</a>
                                                </li>
                                                <li>
                                                    <a href="javascript:rateModel(<?php echo $mid?>, 3);" class="rate3" title="It was OK">*</a>
                                                </li>
                                                <li>
                                                    <a href="javascript:rateModel(<?php echo $mid?>, 4);" class="rate4" title="I liked it">*</a>
                                                </li>
                                                <li>
                                                    <a href="javascript:rateModel(<?php echo $mid?>, 5);" class="rate5" title="I loved it">*</a>
                                                </li>
                                            </ul>
                                        </ul>
                                    </div>
                                </div>
                                <div class="product-stat">
                                    <a href="#comments">(<?php echo count($model_comments)?>) 评论</a>
                                </div>
                            </div>
                        </div>
                        <div class="send-message" style="display: none;">
                            <a href="/forum/index.php?t=ppost&toi=21166&back_to_model=/model/209888/snap-bangle.html?li=send_message" class="secondary-button-inset">Contact Designer</a>
                        </div>
                    </div>
                    <div class="span-9">
                        <div class="content-container-left">
                            <div class="slideshow clearfix">
                                <div id="slideShowLeft" style="display:none;" class="slideshow-left-arrow">
                                    <a href="javascript:prevPicture()"></a>
                                </div>
                                <div id="slideShowRight" style="display:none;" class="slideshow-right-arrow">
                                    <a href="javascript:nextPicture()"></a>
                                </div>
                                <div class="slideshow-big-img-container" id="slideshow-big">
                                    <center>
                                        <img class="slideshow-big-img" src="<?php echo $model_info->picture?>" alt="<?php echo $model_info->mname?>">
                                    </center>
                                </div>
                                <div class="film-strip-container">
                                    <div class="film-strip" id="film-strip">
                                    	<?php 
                                    	$picture_count = count($model_pictures);
                                    	$picture_index = 0;
                                    	foreach ($model_pictures as $picture){
										?>
										<a id="picThumb<?php echo $picture_index?>" class="slideshow-thumb <?php echo ($picture_count == $picture_index)?'selected -last':'selected -last'?>" href="javascript:showPicture(<?php echo $picture_index?>)">
                                            <center>
                                                <img src="<?php echo $picture->path . $picture->name?>" alt="<?php echo $picture->name?>" width="118" height="87">
                                            </center>
                                        </a>
                                        <div class="slideshow-big-ondeck" id="pic<?php echo $picture_index?>">
                                            <center>
                                                <img src="<?php echo $picture->path . $picture->name?>" alt="<?php echo $picture->name?>" width="674" height="501">
                                                <div class="caption">
                                                    <?php echo $picture->name?>
                                                </div>
                                            </center>
                                        </div>
                                    	<?php
                                    	$picture_index++;
                                    	}
                                    	?>
                                    </div>
                                </div>
                            </div>
                            <div class="description clearfix">
                                <div class="social">
                                    <!-- JiaThis Button BEGIN -->
									<!-- JiaThis Button END -->
                                </div>
                                <div class="description-section">
                                    <div class="item-description">
                                        <?php echo $model_info->mname?>
                                        <br/>
                                        <?php echo $model_info->describes?>
                                    </div>
                                </div>
                                <div class="spec-numbers-left">
                                    <strong>cm:</strong>
                                    6.898            w x
                                    5.782            d x
                                    0.576            h
                                </div>
                                <div class="spec-numbers-right">
                                    <strong>in:</strong>
                                    2.716            w x
                                    2.276            d x
                                    0.227            h
                                </div>
                            </div>
                            <div class="report-abuse">
                                <a href="javascript:void(0);">Report abuse</a>
                            </div>
                        </div>
                        <!-- 
                        <div class="related-items grid-view">
                            <div class="product-row-name">
                                <h3>Related items in<a href="/jewelry">Jewelry</a></h3>
                            </div>
                            <div class="grid-view">
                                <div class="product-row clearfix">
                                    <div class="product-box ">
                                        <div class="clearfix">
                                            <div class="product-img">
                                                <a href="/model/342377/glados-ring-black-quot-half-quot-of-ring.html?li=productBox-search" class="product-url">
                                                    <center>
                                                        <img src="/mstatic/model/picture/220x165_342377_852686_1362469975.jpg" width="220" height="165" alt="">
                                                    </center>
                                                </a>
                                            </div>
                                            <div class="product-details">
                                                <div class="product-name">
                                                    <a href="/model/342377/glados-ring-black-quot-half-quot-of-ring.html?li=productBox-search">GLaDOS Ring (Black &quot;Half&quot; of Ring)</a>
                                                </div>
                                                <div class="designer">
                                                    by 
                                                    Ammnra 
                                                </div>
                                                <div class="product-description">
                                                </div>
                                                <div style="clear:left;">
                                                    &nbsp;
                                                </div>
                                                <div class="price-rating-container clearfix">
                                                    <div class="ratingDivOuter">
                                                        <div class="ratingDiv">
                                                            (16)
                                                            &nbsp;
                                                        </div>
                                                        <div class="rating">
                                                            <ul>
                                                                <li class="current" style="width: 3.81em;">
                                                                    &nbsp;
                                                                </li>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                    <div class="price">
                                                        <div class="price-text">
                                                            <span>From:</span>
                                                            <strong>$9.00</strong>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div style="clear:left;height:1px;">
                                            &nbsp;
                                        </div>
                                    </div>
                                    <div class="product-box ">
                                        <div class="clearfix">
                                            <div class="product-img">
                                                <a href="/model/60798/tendrils-8-pieces.html?li=productBox-search" class="product-url">
                                                    <center>
                                                        <img src="/mstatic/model/picture/220x165_60798_92913_1338413385.jpg" width="220" height="165" alt="">
                                                    </center>
                                                </a>
                                            </div>
                                            <div class="product-details">
                                                <div class="product-name">
                                                    <a href="/model/60798/tendrils-8-pieces.html?li=productBox-search">Tendrils (8 pieces)</a>
                                                </div>
                                                <div class="designer">
                                                    by 
                                                    elaverr 
                                                </div>
                                                <div class="product-description">
                                                </div>
                                                <div style="clear:left;">
                                                    &nbsp;
                                                </div>
                                                <div class="price-rating-container clearfix">
                                                    <div class="ratingDivOuter">
                                                        <div class="ratingDiv">
                                                            (4)
                                                            &nbsp;
                                                        </div>
                                                        <div class="rating">
                                                            <ul>
                                                                <li class="current" style="width: 4.5em;">
                                                                    &nbsp;
                                                                </li>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                    <div class="price">
                                                        <div class="price-text">
                                                            <span>From:</span>
                                                            <strong>$40.00</strong>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div style="clear:left;height:1px;">
                                            &nbsp;
                                        </div>
                                    </div>
                                    <div class="product-box last">
                                        <div class="clearfix">
                                            <div class="product-img">
                                                <a href="/model/413096/cosma-silver-bangle.html?li=productBox-search" class="product-url">
                                                    <center>
                                                        <img src="/mstatic/model/picture/220x165_413096_152074_1343237909.jpg" width="220" height="165" alt="">
                                                    </center>
                                                </a>
                                            </div>
                                            <div class="product-details">
                                                <div class="product-name">
                                                    <a href="/model/413096/cosma-silver-bangle.html?li=productBox-search">Cosma Silver Bangle</a>
                                                </div>
                                                <div class="designer">
                                                    by 
                                                    kevinweinewyork 
                                                </div>
                                                <div class="product-description">
                                                </div>
                                                <div style="clear:left;">
                                                    &nbsp;
                                                </div>
                                                <div class="price-rating-container clearfix">
                                                    <div class="ratingDivOuter">
                                                        <div class="ratingDiv">
                                                            (28)
                                                            &nbsp;
                                                        </div>
                                                        <div class="rating">
                                                            <ul>
                                                                <li class="current" style="width: 4.64em;">
                                                                    &nbsp;
                                                                </li>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                    <div class="price">
                                                        <div class="price-text">
                                                            <span>From:</span>
                                                            <strong>$51.09</strong>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div style="clear:left;height:1px;">
                                            &nbsp;
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <br>
                            <div class="see-more">
                                <a href="/jewelry">See
                                    More: Jewelry &raquo;</a>
                            </div>
                        </div>
                         -->
                        <div id="comments" class="comments">
						    <a name="comments"></a>
						    <h3>评论</h3>
						    <script type="text/javascript">
						        function readURL(input){
						            if (window.FileReader && window.File) {
						                if (input.files && input.files[0]) {
						                    var ext = input.files[0].type;
						                    var reader = new FileReader();
						                    reader.onload = function(e){
						                        $('#commentBox').addClass('with-file');
						                        $('#comment-file-preview-container').addClass('visible');
						                        $('#comment-file-preview').attr({
						                            src: e.target.result
						                        }).addClass('visible');
						                        $('#comment-photo-button-tooltip').html('更换照片');
						                    }
						                    
						                    reader.readAsDataURL(input.files[0]);
						                }
						            }
						            else {
						                $('#commentBox').addClass('with-file');
						                $('#comment-file-preview-container').addClass('visible');
						                $('#comment-file-preview').attr('src', '/rrstatic/img/comment-photo-default.png').addClass('visible');
						                $('#comment-photo-button-tooltip').html('更换照片');
						            }
						            
						            $('.tooltip').html('更换这张照片');
						            
						        }
						    </script>
						    <div class="comments-container clearfix">
						    	<?php 
						    	if ($is_login){
								?>
						        <div class="comment-prompt clearfix">
						            <div class="avatar">
						                <img height="50" width="50" src="/rrstatic/img/avatar/nopicture-2013031201.png" alt="Stony">
						            </div>
						            <form action="/ajax/comment.php"  target="customizeCommentIframe" id="customizeCommentForm" method="post" enctype="multipart/form-data">
						                <input type="hidden" name="mid" value="<?php echo $mid?>"/>
						                <input type="hidden" name="uid" value="<?php echo $uid?>"/>
						                <input type="hidden" name="uname" value="<?php echo $username?>"/>
						                <input type="hidden" name="replyId" value=""/>
						                <input type="hidden" name="method" value="add"/>
						                <div class="comment-input">
						                    <textarea class="instructional" id="commentBox" name="commentText">你想要分享吗? @说起 用户直接分享给他们。</textarea>
						                    <div id="comment-file-preview-container">
						                        <img src="" alt="" title="" id="comment-file-preview" style="cursor: pointer">
						                        <div class="gradient-mask"></div>
						                    </div>
						                </div>
						                <div class="comment-prompt-actions">
						                    <div class="submit-comment right">
						                        <a id="submitComment" class="secondary-button-inset" href="javascript:void(0);">发表评论</a>
						                    </div>
						                    <div class="comment-photo-button ">
						                        <label id="filefield-label" for="filefield" class="subtle-button-inset">
						                            <input id="filefield" type="file" name="uploadedPicture" onchange="readURL(this)">
						                        </label>
						                        <div id="comment-photo-button-tooltip" class="tooltip">
						                            添加图片
						                        </div>
						                    </div>
						                </div>
						            </form>
						        </div>
								<?php 
								}else{
								?>
						    	<div class="comment-prompt clearfix">
				                     <a href="/page/login.php?destinationUrl=/page/model.php?mid=<?php echo $mid?>">请登录后评论</a>
				                </div>
								<?php
								}
						    	?>
						        <div style="clear:left;height:1px;">&nbsp;</div>
						        <div id="commentsContainer">
						        	<?php 
						        	foreach ($model_comments as $comment){
										$href = '/page/designer.php?n='.$comment->name . '&uid=' . $comment->comment_by;
									?>
						            <a name="comment-<?php echo $comment->id?>"></a>
						            <div id="comment-<?php echo $comment->id?>" class="comment  clearfix">
						                <div class="avatar">
						                    <a href="<?php echo $href?>">
						                    	<img height="50" width="50" src="/rrstatic/img/avatar/nopicture-2013031201.png" alt="duann">
						                    </a>
						                </div>
						                <div class="comment-wrap">
						                    <div class="clearfix">
						                        <div class="commenter">
						                            <a href="<?php echo $href?>">
						                            	<strong><?php echo $comment->name?></strong>
						                            </a>：
						                        </div>
						                        <?php if($uid == $comment->comment_by){
						                        ?>
						                        <div class="comment-tools">
                                                    <div class="">
                                                        <a class="icon delete"><span class="hover">删除评论</span></a>
                                                        <input type="hidden" class="commentId" value="<?php echo $comment->id?>"/>
                                                    </div>
                                                </div>
						                        <?php 
						                        }else{
						                        ?>
						                        <div class="comment-tools">
						                            <div class="">
						                                <a class="icon flag" href="javascript:void(0);">
						                                	<span class="hover">标记为垃圾评论</span>
						                                </a>
						                            </div>
						                        </div>
						                        <?php 
						                        }?>
						                    </div>
						                    <div class="comment-body">
						                    	<?php 
						                    	if(is_null($comment->img)){
						                    	?>
						                        <div class="comment-text ">
						                            <span><?php echo $comment->comment?></span>
						                        </div>
						                    	<?php 
						                    	}else{
													$f_title = '<strong>'.$comment->name.'&nbsp;:&nbsp;</strong>&lt;a href=&quot;'.$href.'&quot;&gt;&lt;/a&gt;' . $comment->comment;
						                    	?>
						                    	<div class="comment-text with-file">
                                                    <!-- <a href="/designer/Kenny_Van">@Kenny_Van</a> -->
                                                    <span><?php echo $comment->comment?></span>
                                                </div>
						                    	<div class="comment-file-wrap">
                                                    <div class="comment-image" style="background-image: url('/mstatic/model/comment/picture/118x_58_14273_1359558828.jpg');" alt="Photo by <?php echo $comment->name?>"></div>
                                                    <div class="comment-image-mask"></div>
                                                    <a class="comment-file-container fancybox" fancyTitle="<?php echo $f_title?>"  rel="group" href="<?php echo $comment->img?>"></a>
                                                </div>
						                    	<?php 	
						                    	}
						                    	?>
						                    </div>
						                    <div class="comment-actions">
							                    <?php if($uid != $comment->comment_by){
							                    ?>
						                        <div class="comment-reply" id="reply-comment-<?php echo $comment->id?>">
						                            <a class="subtle-button-inset small" href="javascript:void(0)" onclick="commentReply('<?php echo $comment->name?>')">回复</a>
						                        </div>
							                    <?php
							                    }?>
						                        <div class="comment-timestamp">
						                           <?php echo $comment->comment_time?>
						                        </div>
						                    </div>
						                </div>
						            </div>
						        	<?php 
									}
						        	?>
						            <script>
						            function deleteMyComment(e){
						                if (confirm("你确定你要删除这个评论?")) {
						                    var commentId = jQuery(e.target).siblings().val();
						                    jQuery.ajax({
						                        url: '/ajax/comment.php',
						                        type: 'post',
						                        data: {
						                            commentId: commentId,
						                            method : 'delete'
						                        },
						                        success: function(response){
						                            if (response) {
						                                //remove comment from screen
						                                jQuery('#comment-' + commentId).remove();
						                                jQuery('a[name=comment-' + commentId + ']').remove();
						                            }
						                        }
						                    });
						                }
						            }

						            function commentReply(replyUsername){
						            	if(!$.swPortal.isLogin){
		                                 	//window.location.href = '/page/login.php';
		                                 	alert("登录后才能发表评论...........");
		                                 	return;
		                                 }
						                document.location.href = '#comments';
						                $('#commentBox').val('@' + replyUsername + ' ').focus().removeClass("instructional").addClass("focus").caretToEnd();
						                $('#customizeCommentForm input[name=replyId]').attr('value',replyUsername);
						            }
						            function requestComment(){
						            	$('#submitComment').addClass('waiting');
					                    $file = $('#customizeCommentForm input[type=file]').attr('value');
					                    var formData = $("#customizeCommentForm").serialize();
					                    $.ajax({
				                            type: "POST",
				                            url: '/ajax/comment.php',
				                            data: formData,
				                            dataType: 'html',
				                            success: function (content) { 
					                            if(content != null && $('#submitComment').hasClass('waiting')){
					                            	$('#submitComment').removeClass('waiting').addClass('success');
                                                    setTimeout(function(){
                                                        var nums = $(".product-stat a[href=#comments]").text();
                                                        var reg = /[1-9][0-9]*/g;
                                                        var numList = nums.match(reg);
                                                        var str = "(" + (Number(numList,10) + 1) + ") 评论";
                                                  	    $(".product-stat a[href=#comments]").empty().html(str);
                                                    },1000);
                                                    setTimeout(function(){
                                                        $('#submitComment').removeClass('success');
                                                    }, 2000);
                                                    $("#commentsContainer").prepend(content);
                                                    //$("#commentBox").val("你想要分享吗? @说起 用户直接分享给他们。").addClass("instructional").removeClass("focus");
                                                    $("#commentBox").val("你想要分享吗? @说起 用户直接分享给他们。");
                                                    $("#commentBox").addClass("instructional").removeClass('focus');
                                                    $("#image-preview").width('41px');
                                                    $('#filefield').val('');
                                                    
                                                    $('#comment-file-preview-container').removeClass('visible');
                                                    $('#comment-file-preview').attr('src', '').removeClass('visible');
                                                    $('#commentBox').removeClass('with-file');
                                                    $('.tooltip').html('添加图片');
						                        }else{
						                        	$('#submitComment').removeClass('waiting').addClass('fail');
						                            alert(content);
						                            $('#submitComment').removeClass('fail');
								                }
	                                        }, 
	                                        error: function (XMLHttpRequest, textStatus, errorThrown) { 
	                                        	$('#submitComment').removeClass('waiting').addClass('fail');
					                            alert(textStatus);
					                            $('#submitComment').removeClass('fail');
	                                        } 
				                        });
									}
						            jQuery(document).ready(function(){

						                jQuery(document).ready(function(){
						                    $('.icon.delete').live('click', deleteMyComment);
						                });
						                
						                $('.deleteMyComment').live('click', deleteMyComment);
						                
						                $("#submitComment").click(function(e){
						                    var commentText = $("#commentBox").val();
						                    if (commentText == "你想要分享吗? @说起 用户直接分享给他们。" && !$('#commentBox').hasClass('with-file')) {
						                        alert('对不起,您必须输入注释或添加一个图片。');
						                        return;
						                    }
						                    else
						                     if ($('#commentBox').hasClass('with-file') && commentText == "你想要分享吗? @说起 用户直接分享给他们。") {
						                            $("#commentBox").val('');
						                        }
						                    requestComment();
						                    //$('#customizeCommentForm').submit();
						                    //$('#submitComment').addClass('waiting');
						                });
						                /***
						                $('#customizeCommentIframe').load(function(){
						                    var response = $('#customizeCommentIframe').contents().find("body").text();
						                    //console.dir($('#customizeCommentIframe').contents());
						                    //console.dir($('#customizeCommentIframe').contents().find('pre'));
						                    //console.dir($('#customizeCommentIframe').contents().find("body").html());
						                    //console.dir($('#customizeCommentIframe').contents().find("body").text());
						                 if (response == '' || response == null) {
						                        return false;
						                    }
						                    
						                    var content = $.parseJSON(response);
						                    if (content) {
						                        var responseError = content.error;
						                        if (responseError != null) {
						                            $('#submitComment').removeClass('waiting').addClass('fail');
						                            alert(responseError);
						                            $('#submitComment').removeClass('fail');
						                        }
						                        else
                                             if (content.html != null && $('#submitComment').hasClass('waiting')) {
                                                        var htmlContent = base64_decode(content.html);
                                                        
                                                        $('#submitComment').removeClass('waiting').addClass('success');
                                                        setTimeout(function(){
                                                            $('#submitComment').removeClass('success');
                                                        }, 3000);
                                                        //$("#commentsContainer").append(htmlContent);
                                                        $("#commentsContainer").prepend(htmlContent);
                                                        //$("#commentsContainer").empty().html(htmlContent);
                                                        $("#commentBox").val("你想要分享吗? @说起 用户直接分享给他们。").addClass("instructional").removeClass("focus");
                                                        $("#image-preview").width('41px');
                                                        $('#filefield').val('');
                                                        
                                                        $('#comment-file-preview-container').removeClass('visible');
                                                        $('#comment-file-preview').attr('src', '').removeClass('visible');
                                                        $('#commentBox').removeClass('with-file');
                                                        $('.tooltip').html('添加图片');
                                                    }
						                    }
						                });***/
						            });

						            (function($){
						                // Behind the scenes method deals with browser
						                // idiosyncrasies and such
						                $.caretTo = function(el, index){
						                    if (el.createTextRange) {
						                        var range = el.createTextRange();
						                        range.move("character", index);
						                        range.select();
						                    }
						                    else 
						                        if (el.selectionStart != null) {
						                            el.focus();
						                            el.setSelectionRange(index, index);
						                        }
						                };
						                
						                // The following methods are queued under fx for more
						                // flexibility when combining with $.fn.delay() and
						                // jQuery effects.
						                
						                // Set caret to a particular index
						                $.fn.caretTo = function(index, offset){
						                    return this.queue(function(next){
						                        if (isNaN(index)) {
						                            var i = $(this).val().indexOf(index);
						                            
						                            if (offset === true) {
						                                i += index.length;
						                            }
						                            else 
						                                if (offset) {
						                                    i += offset;
						                                }
						                            
						                            $.caretTo(this, i);
						                        }
						                        else {
						                            $.caretTo(this, index);
						                        }
						                        
						                        next();
						                    });
						                };
						                
						                // Set caret to beginning of an element
						                $.fn.caretToStart = function(){
						                    return this.caretTo(0);
						                };
						                
						                // Set caret to the end of an element
						                $.fn.caretToEnd = function(){
						                    return this.queue(function(next){
						                        $.caretTo(this, $(this).val().length);
						                        next();
						                    });
						                };
						            }(jQuery));

						            function base64_decode(data){
						                var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
						                var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = "", tmp_arr = [];
						                
						                if (!data) {
						                    return data;
						                }
						                
						                data += '';
						                
						                do {
						                    h1 = b64.indexOf(data.charAt(i++));
						                    h2 = b64.indexOf(data.charAt(i++));
						                    h3 = b64.indexOf(data.charAt(i++));
						                    h4 = b64.indexOf(data.charAt(i++));
						                    
						                    bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
						                    
						                    o1 = bits >> 16 & 0xff;
						                    o2 = bits >> 8 & 0xff;
						                    o3 = bits & 0xff;
						                    
						                    if (h3 == 64) {
						                        tmp_arr[ac++] = String.fromCharCode(o1);
						                    }
						                    else 
						                        if (h4 == 64) {
						                            tmp_arr[ac++] = String.fromCharCode(o1, o2);
						                        }
						                        else {
						                            tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
						                        }
						                }
						                while (i < data.length);
						                
						                dec = tmp_arr.join('');
						                
						                return dec;
						            }
						            </script>
						        </div>
						    </div>
						    <div style="clear:left;height:1px;">
						        &nbsp;
						    </div>
						</div>
						                        
                    </div>
                    <div class="span-3 last">
                        <div id="purchaseDetails" class="content-container-right">
                            <!-- START CURRENCY / COUNTRY SELECT --><!-- START MATERIAL SELECT AND ADD TO CART -->
                            <h5>材料选项</h5>
                            <ul id="materialSelectControl" class="material-selected">
                                <li class="material-list-item-selected" id="selectedMaterialContent">
                                    <p>
                                        White Strong & Flexible
                                    </p>
                                    <div class="expand-arrow">
                                    </div>
                                    <div class="swatch">
                                        <img src="/rrstatic/img/materials/plastic_wsf_white.jpg" class="material-swatch" alt="White Strong & Flexible" width="65" height="35">
                                    </div>
                                    <div class="price">
                                        $18.03
                                    </div>
                                </li>
                            </ul>
                            <ul id="materialSelect" class="material-select">
                            <?php 
                            foreach ($model_material as $material){
                            ?>
                                <li class="material-list-item clearfix" id="materialContent<?php echo $material->id?>">
                                    <p>
                                        <?php echo $material->name?>
                                    </p>
                                    <div class="expand-arrow">
                                    </div>
                                    <div class="swatch">
                                        <img src="<?php echo $material->img?>" class="material-swatch" alt="<?php echo $material->name?>">
                                    </div>
                                    <div class="price">
                                        ¥<?php echo $material->price?>
                                    </div>
                                </li>
                            <?php 	
                            }
                            ?>
                            </ul>
                            <div class="clearfix">&nbsp;</div>
                            <div id="addToCartButton" class="add-to-cart-btn">
                                <a>加入购物车</a>
                            </div>
                            <div id="experimentalMaterialNotice" class="experimentalNotice" style="display:none">
                                <strong>Caution!</strong>
                                This material is experimental.<a href="/materials/elasto_plastic">Read more</a>.
                            </div>
                            <script>
                            function close_material_popup(){
	                                var pop = document.getElementById('materialSelect');
	                                pop.style.display = 'none';
	                            }
	
	                            $("#addToCartButton").click(function(e){
	                            	 if(!$.swPortal.isLogin){
	                                 	//window.location.href = '/page/login.php';
	                                 	alert("请登录后操作...........");
	                                 	return;
	                                 }
	                                var params = {
	                                    itemId: $.swPortal.modelPageModelId,
	                                    materialId: $.swPortal.modelPageMaterialId,
	                                    uid : $.swPortal.uid,
	                                    mid : $.swPortal.mid,
	                                    method : "add"
	                                };
	                                if (typeof $.swPortal.modelPageModelKey != 'undefined') {
	                                    params.key = $.swPortal.modelPageModelKey;
	                                }
	                                //$.swPortal.addToCartPopup('/cart/add/ajax', params);
	                                $.swPortal.addToCartPopup('/ajax/cart.php', params);
	                                return false;
	                            });
								//      setTimeout(function() { close_addtocart_popup(); }, 3900);
                            </script>
                        </div>
                        <div class="content-container-right clearfix">
                            <div class="add-to-faves">
                                <a id="wishlistLink" href="javascript:addToWishlist()" class="add-to-wishlist <?php echo $is_wishlist?'disabled':''?>">关注</a>
                                <div class="separator-hr">
                                </div>
                                <a id="favoritesLink" href="javascript:addToFavorites()" class="add-to-faves <?php echo $is_favorites?'disabled':''?>">收藏</a>
                                <div id="favoriters">
                                    <h5>同样收藏</h5>
                                    <div class="inner-right-container favoriters">
                                        <div class="favoriters-inner">
                                            <div id="youFavorite" class="avatar" style="display:none;">
                                                <a href="/page/designer.php?uid=<?php echo $uid?>"><img width="30" height="30" src="/rrstatic/img/avatar/nopicture-2013031201.png" alt="Stony"></a>
                                            </div>
                                            <?php 
                                            foreach ($model_favorites as $favorite){
                                            ?>
                                            <div class="avatar">
                                                <a href="/page/designer.php?uid=<?php echo $favorite->uid?>"><img height="30" width="30" src="/rrstatic//img/avatar/nopicture-2013031201.png" alt="<?php echo $favorite->name?>"></a>
                                            </div>
                                            <?php 
                                            }
                                            ?>
                                            <div class="favs-truncated">
                                                <?php echo count($model_favorites)?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="content-container-right clearfix">
                            <a href="/shops/electrobloom">
                            	<h5>更多设计 &raquo;</h5>
                            </a>
                            <div class="more-from-shop">
                            	<?php 
                            	foreach ($model_designs as $design){
                            	?>
                                <div class="more-from-shop-img">
                                    <a href="/page/model.php?mid=<?php echo $design->m_id?>">
                                        <center>
                                            <img src="<?php echo $design->path . $design->iname?>" width="83" height="62" alt="<?php echo $design->mname?>">
                                        </center>
                                    </a>
                                </div>
                            	<?php 	
                            	}
                            	?>
                            </div>
                        </div>
                        <div style="clear:left;height:1px;">&nbsp;</div>
					    <div class="content-container-right clearfix">
					        <h5>关键字</h5>
					        <?php 
					        foreach ($model_keys as $key){
					        ?>
					        <div class="inner-right-container">
			                      <a href="/page/search.php?tag=<?php echo $key?>" class="key-word"><?php echo $key?></a>
			                </div>
					        <?php
					        }
					        ?>
					     </div>
                    </div>
                    <script type="text/javascript">
                        var _gaq = _gaq || [];
	                        _gaq.push(['b._setAccount', 'UA-22310755-1']);
	                        _gaq.push(['b._trackPageview']);
                    </script>
                </div>
                <iframe name="customizeCommentIframe" id="customizeCommentIframe" style="display:none"></iframe>
            </div>
            <!-- begin bottom.tpl -->
            <?php include VIEW . '/footer.php';?>
            <!-- LEGAL -->
			<?php include VIEW . '/footer_legal.php';?>
        </div>
        <script>
            $('input[placeholder], textarea[placeholder]').placeholder();
        </script>
        <!--[if IE]>
            <div id="iecontainer"></div>
        <![endif]-->
    </body>
</html>